package com.system.common.config;

import com.system.common.service.purview.PurviewService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;


/**
 * 系统初始化数据配置
 */
@Component
@Order(1)
public class SystemInitConfig implements CommandLineRunner {
    private static Logger logger = LoggerFactory.getLogger(SystemInitConfig.class);
    @Autowired
    private PurviewService purviewService;

    @Override
    public void run(String... args) throws Exception {
        logger.info("开始初始化系统数据...");
        // 初始权限数据
        purviewService.initPurview();
        logger.info("初始化系统数据完成...");
    }
}
